var tplDetalleOC = 
	'<div>'+
		'<div>'+
			'<div class="item-img"><img src="resources/images/shopping_cart.png"></div>'+
			'<div class="detail-totNeto-moneda">{totalNeto} {moneda}</div>'+
			'<div class="detail-fecha">Fecha: {fecha}</div>'+
			'<div class="detail-ordCompra">Ord. Compra: {ordenCompra}</div>'+
		'</div>'+
		'<br/>'+
		'<div class="detail-data2">'+
			'<div>Empresa: {empresa}</div>'+
			'<div>Org. Compras: {orgCompras}</div>'+
			'<div>Cond. Pago: {condPago}</div>'+		
			'<div>Clase Doc.: {claseDoc}</div>'+
			'<div>Grupo Compra: {grpCompras}</div>'+			
			'<div>Tipo de Cambio: {tc}</div>'+
			'<div>Cod. Proveedor: {codProveedor}</div>'+
			'<div>Proveedor: {proveedor}</div>'+			
			'<div>Tot. Bruto: {totalBruto}</div>'+
			'<div>Grupo Lib.: {grpLiberacion}</div>'+
			'<div>Est. Lib.: {estLiberacion}</div>'+
			'<div>Ind. Lib.: {indLiberacion}</div>'+
			'<div>Cod. Lib.: {codLiberacion}</div>'+
		'</div>'+
	'</div>';

detalleOrdenCompra = Ext.extend(Ext.Panel, 
{
	layout: 'card',
	initComponent: function() 
	{
		this.dockedItems = [
		{
			xtype: 'toolbar',
			dock: 'top',
			title: 'Detalle OC',
			items: [
			{
				ui: 'back',
				text: 'Volver',
				scope: this,
				handler: function()
				{
					this.ownerCt.setActiveItem(this.prevCard, 
					{
						type: 'slide',
						reverse: true,
						scope: this,
						after: function()
						{
							this.destroy();
						}
	                });
				}
			}]
		},
		{
        	xtype: 'toolbar',
        	dock: 'bottom',
        	items: [
        	{
        		xtype: 'button',
        		text: 'Aprobar',
        		ui: 'confirm',
        		scope: this,
        		handler: function()
        		{
        			Ext.Msg.alert('', 'Aprobado', function(res)
        			{
        				this.ownerCt.setActiveItem(this.prevCard,
        				{
        					type: 'slide',
        					reverse: true,
        					scope: this,
        					after: function()
        					{
        						this.destroy();
        					}
        				});
        			}, this);        			
        		}
        	},
        	{
        		xtype: 'spacer'
        	},
        	{
        		xtype: 'button',
        		text: 'Rechazar',
        		ui: 'decline',
        		scope: this,
        		handler: function()
        		{
	        		Ext.Msg.alert('', 'Rechazado', function(res)
	        		{
	    				this.ownerCt.setActiveItem(this.prevCard,
	    				{
	    					type: 'slide',
	    					reverse: true,
	    					scope: this,
	    					after: function()
	    					{
	    						this.destroy();
	    					}
	    				});
	    			}, this);
        		}
        	}]
        }];
		
		this.detalleOCPanel = new Ext.Panel(
        {
        	layout: 'fit',
        	
            items: [
            {
            	scroll: 'vertical',
            	data: this.record.data,
            	tpl: tplDetalleOC        	
            }]
        });
		
        this.items = this.detalleOCPanel;
                
        detalleOrdenCompra.superclass.initComponent.call(this);
    }
});

Ext.reg('detalleOrdenCompra', detalleOrdenCompra);